﻿<?php 
require_once(dirname(__FILE__)."/../../libs/login/login.php"); 
require_once(dirname(__FILE__)."/../../libs/dbclass/dbconnect.php");
require_once(dirname(__FILE__)."/../../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../../admin/libs/power_class.php");
require_once(dirname(__FILE__)."/../../admin/libs/shuxing_class.php");
$lg=new login();
$lg->checklogin("admin_member");//检验是否登录
$sx=new shuxing();
$mc=new libstr();
$pw=new power();

$id=$_GET["id"];
if(!$mc->isnum($id)){
	$mc->msg("参数错误！");
}
	
$tb="member_class";
$mydata=$pw->cata_detail($id,$tb);


//权限角色
$getrs=$sx->getshuxinglist("power_class");

if ($mc->Ismp($_POST["Submit"])!="")
{
	$classname=$_POST["classname"];
	$pid=$_POST['pid'];
	$content=$_POST["content"];
	$order=$_POST["classorder"];
	$quanxian=$_POST["quanxian"];
$pw->cata_edit($id,$classname,$pid,$content,$order,$tb,$quanxian);
$mc->msg("修改成功","identity_class.php?classid=".$_GET['classid']);	

}
$path="编辑身份级别";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:#fff"> 
<div class="content">
    <div class="right">
<form name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
      <td width="100%" height="24" class="top_head">&nbsp;</td>
    </tr>
    <tr>
      <td valign="top">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="1%" align="right"  height="45">&nbsp;</td>
              <td width="99%" >
               <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="55%" style="padding-left:20px;padding-top:10px;"><img src="../images/head.gif" width="13" height="11"><b><?php echo $path;?></b><a href="identity_class.php" style=" margin-left:20px; text-decoration:underline;">返回列表</a></td>
                  <td width="45%" align="right">&nbsp;</td>
                </tr>
              </table>
              </td>
            </tr>
          </table>
      </td>
    </tr>
   </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="liebiao">
  <tr>
    <td width="11%" height="50" align="right">类别名称：</td>
    <td height="50"><input name="classname" type="text" id="classname" value="<?php echo $mydata['classname'];?>" ><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle" >上级类别：</td>
    <td height="50" valign="middle" ><select name="pid" id="pid" <?php if ($pw->myck($id,$tb)=="true"){?>disabled="true"<?php }//只有底层的类菜可以修改?>>
          <option value="0">无</option>
		    <?php
		    $db->depth=0;
    	    $twhere="";
		    $db->getchild("member_class",0,$mydata['pid'],"ID",".",$twhere);
          ?>
        </select><Font>
   </Font></td>
    </tr>
    
      <tr>
    <td height="50" align="right" valign="middle" >配置权限：</td>
    <td height="50" valign="middle" ><select name="quanxian" id="pid" >
          <option value="0">选择权限组</option>
		 <?php foreach ($getrs as $rs){?>
		  <option value="<?php echo $rs["ID"]?>" <?php if( $rs["ID"]==$mydata['quanxian']){?>selected<?php }?>><?php echo $rs["classname"]?></option>
		 <?php }?>
        </select><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">类别排列：</td>
    <td height="50" valign="middle"><input name="classorder" type="text" id="classorder" value="<?php echo $mydata['classorder'];?>" ><Font>
   (必须为数字)</Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">备注说明：</td>
    <td height="50" valign="middle"><textarea name="content" id="content" cols="30"  rows="2"><?php echo $mydata["content"];?></textarea>
      <Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">&nbsp;</td>
    <td height="50" valign="middle"><bdo>
      <input type="submit" name="Submit" value="提交"> <input type="button" name="Submit2" value="返回" onClick="location.href='identity_class.php'">
    </bdo></td>
    </tr>
    </table>
</form>
</div>
</div>
</body>
</html>
